package net.zjitc.api;

import java.util.Scanner;

/**
 * @Author admin
 * @Date 2019/3/27 8:38
 */
public class CountNumber {
    public static void main(String[] args) {
        System.out.println(" 请输入一字符串");
        Scanner scanner=new Scanner(System.in);
        String s=scanner.nextLine();

        int count1=0,count2=0,count3=0,count4=0;
        for (int i = 0; i <s.length() ; i++) {
            char c=s.charAt(i);
            if (c>='A'&&c<='Z'){
                count1++;
            }else if (c>='a'&&c<='z'){
                count2++;
            }else if (c>='0'&&c<='9'){
                count3++;
            }else {
                count4++;
            }
        }
        System.out.println(" 大写字母有："+count1+"\n小写字母有："+count2+
                "\n数字有："+count3+"\n其他字符："+count4);
    }
}
